/*************************************************
Author: tony
Date: 03/14/2013
Description:
Notes:
*************************************************/
#include "CMountCfg.h"

bool CHuntSoulCfg::IsValidPos (int iPos)
{
    if (iPos <= 0 || iPos > MAX_HUNT_SOUL_GRID)
    {
        return false;
    }

    return true;    
}

int CHuntSoulCfg::GetCfg (int iPos, CHuntSoulCfgUnit & stUnit)
{
    if (!IsValidPos(iPos))
    {
        return ERROR_MOUNT_CONFIG_NONE;
    }
    
    stUnit = _stCfg[iPos - 1];
    return RET_OK;
}

int CHuntSoulCfg::AddCfgUnit (int iPos, const CHuntSoulCfgUnit & stUnit)
{
    if (!IsValidPos(iPos))
    {
        return ERROR_MOUNT_CONFIG_INVALID;
    }

    if (stUnit._ucColor <= MOUNT_COLOR_NONE || stUnit._ucColor > MOUNT_COLOR_NUM)
    {
        return ERROR_MOUNT_CONFIG_INVALID;
    }
    
    _stCfg[iPos - 1] = stUnit;
    
    return RET_OK;
}
